package com.zsrt.java.day20161226.lh.day161226.demo11;

public class DgDemo {
	
	public static void main(String[] args) {
		
//		xuhan();
		
		int sum=dg(10);
		System.out.println(sum);
	}
	
	public static int dg(int max){
		if(max>1){
			return max+dg(max-1);
		}else{
			return 1;
		}
	}
	
	
	
	

	/**
	 * 
	 */
	private static void xuhan() {
		int sum=0;
		int begin=1;
		int end=10;
		while(begin<=10){
			sum=sum+begin;
			begin++;
		}
		System.out.println(sum);
	}

}
